//
//  CXUINavigationController.swift
//  CXSwiftDemo
//
//  Created by 潮汐 on 2023/11/30.
//

import UIKit

class CXUINavigationController: UINavigationController, UINavigationControllerDelegate {

    override func viewDidLoad() {
        super.viewDidLoad()

        self.view.backgroundColor = .white
        
        self.delegate = self
        
        //设置导航栏是否透明
        self.navigationController?.navigationBar.isTranslucent = false
        // Do any additional setup after loading the view.
    }
    
    func navigationController(_ navigationController: UINavigationController, willShow viewController: UIViewController, animated: Bool){
        //隐藏导航栏处理
        var isHideNav = false
        if viewController.isKind(of: CXHomeViewController.self){
            isHideNav = true
        }else if viewController.isKind(of: CXToolsEntController.self){
            isHideNav = true
        }else if viewController.isKind(of: CXDelegateTestVC.self){
            isHideNav = true
        }
        self.setNavigationBarHidden(isHideNav, animated: true)
    }
    


    /*
    // MARK: - Navigation

    // In a storyboard-based application, you will often want to do a little preparation before navigation
    override func prepare(for segue: UIStoryboardSegue, sender: Any?) {
        // Get the new view controller using segue.destination.
        // Pass the selected object to the new view controller.
    }
    */

}



